#!/bin/bash
git fetch -p
branches=$(git branch --merged |grep -v "\*" |grep -v "master") ;# 获取分支名
echo  "$branches";
for branch in $branches
do
git branch -D "$branch";
# echo  delete branch "$branch";
done;
